include ../../make.conf
########### lib ##############
INCLUDES += -I
#INC = -Ifnv/
CFLAGS = -O3
CFLAGS += -Wall
LIBS = -lpthread
#LIBS += fnv/libfnv.a
#CFLAGS += -DNDEBUG
FNV_LIBOBJ = fnv/hash_32.o fnv/hash_64.o fnv/hash_32a.o fnv/hash_64a.o
FNV_OTHEROBJ= fnv/fnv32.o fnv/fnv64.o fnv/fnv32a.o fnv/fnv64a.o
FNV_TARGETS= ${FNV_LIBOBJ} #${FNV_OTHEROBJ}
HASH_FUN = ${FNV_TARGETS} pseHash.o 
#HASH_FUN = fnv/libfnv.a pseHash.o
#HASH_FUN = pseHash.o

all: build 

build: $(HASH_FUN) lib_pseHash.a test

pseHash.o:
	@echo;echo "============================== [$@] =============================="
	g++ $(CFLAGS) $(INC) $(DEFINES) -c pseHash.cpp

lib_pseHash.a:	
	@echo;echo "============================== [$@] =============================="
	ar rvu $@ $(HASH_FUN)
	#ar x $@ $(HASH_FUN)
	
#lib_pseHash.so: $(HASH_FUN)	
#	@echo;echo "============================== [$@] =============================="
#	g++ $(CFLAGS) $(INC) $(LIBS) $(DEFINES) -fPIC -shared $(HASH_FUN) -o $@

test:
	@echo;echo "============================== [$@] =============================="
	g++ $(CFLAGS) $(INC) $(LIBS) $(DEFINES) -o $@ test.cpp fnv/libfnv.a lib_pseHash.a
	#g++ $(CFLAGS) $(INC) $(LIBS) $(DEFINES) -o $@ test.cpp lib_pseHash.a
#	./test

install: pseHash.h #lib_pseHash.so
	cp pseHash.h ../../inc
	cp lib_pseHash.a ../../lib
#	install lib_pseHash.so ../../lib/lib_pseHash.so

clean:
	rm -rf *.o *.a *.so *~ test core
